-
Notifications
You must be signed in to change notification settings - Fork 116
Для OPM исправлен абсолютный путь запуска #1655
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: develop
Are you sure you want to change the base?
Conversation
📝 WalkthroughWalkthroughModified install scripts to use explicit path-qualified invocations instead of relying on PATH environment variables. Changes include updating the oscript binary path resolution and adjusting path quoting conventions in both Unix shell and Windows batch scripts. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches🧪 Generate unit tests (beta)
Tip 🧪 Unit Test Generation v2 is now available!We have significantly improved our unit test generation capabilities. To enable: Add this to your reviews:
finishing_touches:
unit_tests:
enabled: trueTry it out by using the Have feedback? Share your thoughts on our Discord thread! Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🤖 Fix all issues with AI agents
In `@install/opm.bat`:
- Line 5: Update the SET assignment for the environment variable named lib so
the assigned path is quoted to handle spaces; locate the line using the SET
command that assigns lib (currently using %~dp0..\lib) and change it to use the
SET syntax that places the entire assignment in quotes (i.e., use the quoted-set
form) so paths containing spaces are preserved safely.
| setlocal | ||
|
|
||
| set lib="%~dp0..\lib" | ||
| set lib=%~dp0..\lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote the SET value for safety with paths containing spaces.
The lib variable assignment is unquoted. If the installation path contains spaces, this will cause issues. The static analysis tool correctly flags this (SEC002).
Proposed fix
-set lib=%~dp0..\lib
+set "lib=%~dp0..\lib"📝 Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
| set lib=%~dp0..\lib | |
| set "lib=%~dp0..\lib" |
🧰 Tools
🪛 Blinter (1.0.102)
[error] 5-5: Unsafe SET command usage. Explanation: SET commands without proper validation or quoting can cause security issues. Recommendation: Always quote SET values and validate input: SET "var=safe value". Context: SET command value should be quoted for safety
(SEC002)
🤖 Prompt for AI Agents
In `@install/opm.bat` at line 5, Update the SET assignment for the environment
variable named lib so the assigned path is quoted to handle spaces; locate the
line using the SET command that assigns lib (currently using %~dp0..\lib) and
change it to use the SET syntax that places the entire assignment in quotes
(i.e., use the quoted-set form) so paths containing spaces are preserved safely.
EvilBeaver
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Я не очень понял мотивацию предлагаемых изменений. Зачем это нужно и в каких ситуациях?
| setlocal | ||
|
|
||
| set lib="%~dp0..\lib" | ||
| set lib=%~dp0..\lib |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Кролик прав, зачем убраны кавычки?
| OPM=$LIB/opm/src/cmd/opm.os | ||
|
|
||
| oscript $OPM "$@" | ||
| "$THISDIR/oscript" "$OPM" "$@" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
THISDIR указывает на каталог где лежит шеллскрипт и это тот же каталог, где лежит исполняемый файл oscript. Получается, что $THISDIR/oscript аналогично ./oscript
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Или я не понял смысл изменения
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oscript и ./oscript - не одно и то же. Второе будет искать только в текущем каталоге. Первое - в path.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Да, тут я неверно написал. Но смысл изменения все равно непонятен
Без PATH теперь работает.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.